package com.xigua._数学;

/**
 * @author LiRongHua
 * @Title: ${file_name}
 * @Package ${package_name}
 * @Description: ${todo}
 * @date 2022/4/1415:12
 */
public class _357_统计各位数字都不同的数字个数 {

    public static void main(String[] args) {
        System.out.println(countNumbersWithUniqueDigits(3));
    }

    public static int countNumbersWithUniqueDigits(int n) {
        if (n ==0 )return 1;
        int num = 9;
        int count = 9;
        for (int i = 0; i < n-1; i++) {
            count =count*(num-i);
        }
        return countNumbersWithUniqueDigits(n-1)+count;
    }
}
